# routers/summaries.py
import logging
from fastapi import APIRouter, Depends
from schema_base import PageInationResult
from http_base import unified_resp
from ..schemas.meetings_summary import (
    MeetingsSummaryListIn, MeetingsSummaryDetailIn, MeetingsSummaryAddIn, MeetingsSummaryEditIn, MeetingsSummaryDelIn, MeetingsSummaryOut
)
from ..service.meetings.meetings_summary import IMeetingsSummaryService

logger = logging.getLogger(__name__)
router = APIRouter(prefix="/summaries")


@router.post("/list", response_model=PageInationResult[MeetingsSummaryOut], summary="摘要列表")
@unified_resp
async def summary_list(list_in: MeetingsSummaryListIn, svc: IMeetingsSummaryService = Depends()):
    return await svc.list(list_in)


@router.get("/detail", summary="摘要详情")
@unified_resp
async def summary_detail(detail_in: MeetingsSummaryDetailIn = Depends(), svc: IMeetingsSummaryService = Depends()):
    return await svc.detail(detail_in.id)


@router.post("/add", summary="新增摘要")
@unified_resp
async def summary_add(add_in: MeetingsSummaryAddIn, svc: IMeetingsSummaryService = Depends()):
    return await svc.add(add_in)


@router.post("/edit", summary="编辑摘要")
@unified_resp
async def summary_edit(edit_in: MeetingsSummaryEditIn, svc: IMeetingsSummaryService = Depends()):
    return await svc.edit(edit_in)


@router.post("/del", summary="删除摘要")
@unified_resp
async def summary_del(del_in: MeetingsSummaryDelIn, svc: IMeetingsSummaryService = Depends()):
    return await svc.delete(del_in.id)
